import axios from 'axios'
import qs from 'qs'
import router from "../../router/router";
import iView from "view-design";
import Utils from "../../js/Utils";

export default {
    namespaced: true,
    actions: {
        getAllCategory: function ({commit}, params) {
            let {callback} = params;
            params.onget = (data) =>{
                callback(data);
            }
            commit("getAll",params)
        },

    },
    mutations: {
        getAll: function (state, {onget}) {
            axios.get('/category/findAll').then(({data}) => {
                onget(data);
            });
        }
    }

}